{% extends "templates/base.phtml"%}
{%block content%}
<div class="page-content-wrap">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default tabs">
                <ul class="nav nav-tabs" role="tablist">
                    <li class="active"><a href="/admin/config/wx">微信配置</a></li>
                    <li><a href="/admin/config/alipay">支付宝配置</a></li>
                </ul>
                <div class="panel-body tab-content">
                    <div class="tab-pane active">
                        <div class="col-md-12">
                            <h3>微信对接平台配置</h3>
                            <form class="form-horizontal" method="post">
                                <div class="panel panel-default">
                                    <div class="panel-body">

                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">微信公共号名称</label>
                                            <div class="col-md-6 col-xs-12">
                                                <div class="input-group">
                                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                    <input name="wxname" type="text" class="form-control" value="{% if wx.wxname is defined %}{{wx.wxname}}{% endif %}">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">微信号：</label>
                                            <div class="col-md-6 col-xs-12">
                                                <div class="input-group">
                                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                    <input name="weixin" type="text" class="form-control" value="{% if wx.weixin is defined %}{{wx.weixin}}{% endif %}" >
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">AppID:</label>
                                            <div class="col-md-6 col-xs-12">
                                                <div class="input-group">
                                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                    <input name="appid" type="text" class="form-control" value="{% if wx.appid is defined %}{{wx.appid}}{% endif %}">
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">AppSecret：</label>
                                            <div class="col-md-6 col-xs-12">
                                                <div class="input-group">
                                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                    <input name="appsecret" type="text" class="form-control" value="{% if wx.appsecret is defined %}{{wx.appsecret}}{% endif %}">
                                                </div>
                                            </div>
                                        </div>

<!--                                        <div class="form-group">-->
<!--                                            <label class="col-md-3 col-xs-12 control-label">encodingaeskey：</label>-->
<!--                                            <div class="col-md-6 col-xs-12">-->
<!--                                                <div class="input-group">-->
<!--                                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>-->
<!--                                                    <input name="encodingaeskey" type="text" class="form-control" value="{% if wx.encodingaeskey is defined %}{{wx.encodingaeskey}}{% endif %}">-->
<!--                                                </div>-->
<!--                                            </div>-->
<!--                                        </div>-->

                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">原始ID：</label>
                                            <div class="col-md-6 col-xs-12">
                                                <div class="input-group">
                                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>
                                                    <input name="wxid" type="text" class="form-control" value="{% if wx.wxid is defined %}{{wx.wxid}}{% endif %}">
                                                </div>
                                            </div>
                                        </div>

<!--                                        <div class="form-group">-->
<!--                                            <label class="col-md-3 col-xs-12 control-label">公共平台账号:</label>-->
<!--                                            <div class="col-md-6 col-xs-12">-->
<!--                                                <div class="input-group">-->
<!--                                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>-->
<!--                                                    <input type="text" class="form-control">-->
<!--                                                </div>-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-md-3 col-xs-12 control-label">公共平台密码:</label>-->
<!--                                            <div class="col-md-6 col-xs-12">-->
<!--                                                <div class="input-group">-->
<!--                                                    <span class="input-group-addon"><span class="fa fa-pencil"></span></span>-->
<!--                                                    <input type="text" class="form-control">-->
<!--                                                </div>-->
<!--                                            </div>-->
<!--                                        </div>-->
                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">账号类型：</label>
                                            <div class="col-md-6 col-xs-12">
                                                <select name="wxtype" class="form-control select">
                                                    <option value="1" {% if wx.wxtype is defined %} {% if wx.wxtype ==1 %}selected{% endif %}{% endif %}>订阅号</option>
                                                    <option value="2" {% if wx.wxtype is defined %}{% if wx.wxtype ==2 %}selected{% endif %}{% endif %}>服务号</option>
                                                    <option value="3" {% if wx.wxtype is defined %}{% if wx.wxtype ==3 %}selected{% endif %}{% endif %}>认证服务号</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">微信支付：</label>
                                            <div class="col-md-6 col-xs-12">
                                                <select name="wxpay" class="form-control select">
                                                    <option value="1" {% if wx.wxpay is defined %} {% if wx.wxpay ==1 %}selected{% endif %}{% endif %}>已开通</option>
                                                    <option value="0" {% if wx.wxpay is defined %} {% if wx.wxpay ==0 %}selected{% endif %}{% endif %}>未开通</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">头像：</label>
                                            <div class="col-md-6 col-xs-12">
                                                <input id="fileup1" name="fileup1" type="file" multiple="true">
                                                <input id="headpic" name="headpic" class="form-control"  type="hidden" value="{% if wx.headpic is defined %}{{wx.headpic}}{% endif %}">
                                                <img id="thumb1" src="{% if wx.headpic is defined %}{{wx.headpic}}{% endif %}" style="max-height: 200px;max-width: 200px">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-3 col-xs-12 control-label">公众号二维码：</label>
                                            <div class="col-md-6 col-xs-12">
                                                <input id="fileup" name="fileup" type="file" multiple="true">
                                                <input id="qrcode" name="qrcode" class="form-control"  type="hidden" value="{% if wx.qrcode is defined %}{{wx.qrcode}}{% endif %}">
                                                <img id="thumb" src="{% if wx.qrcode is defined %}{{wx.qrcode}}{% endif %}" style="max-height: 200px;max-width: 200px">
                                            </div>
                                        </div>
<!--                                        <div class="form-group">-->
<!--                                            <label class="col-md-3 col-xs-12 control-label">如何绑定URL和Token：</label>-->
<!--                                            <div class="col-md-6 col-xs-12">-->
<!--                                                <a class="btn btn-primary" href="#">点击下载查看</a>-->
<!--                                            </div>-->
<!--                                        </div>-->
                                        <div class="form-group col-md-12">
                                            <div class="col-md-6 col-xs-12 col-md-offset-4">
                                                <button class="btn btn-primary">保存</button>
<!--                                                <button class="btn btn-danger" type="button">取消</button>-->
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{%endblock%}{%block end%}
<style type="text/css">
    .user-info-penal p{
        padding-top: 0.6em;
    }
    table th,table td{
        text-align: center;
    }
</style>
<script src="/assets/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/assets/uploadify/uploadify.css">
<script type="text/javascript">

    $(function() {
        $('#fileup').uploadify({
            'formData'     : {
            },
            'swf'      : '/assets/uploadify/uploadify.swf',
            'uploader' : '/admin/resource/upload',
            'cancelImg': '/assets/uploadify/uploadify-cancel.png',//单个取消上传的图片
            'onUploadSuccess': function (file, data, response) {
                var data = JSON.parse(data);
                if (data.status == 1) {
                    $('#qrcode').val(data.data);
                    $('#thumb').attr("src",data.data);
                    $('#thumb').css("display","block");
                }

            }
        });
        $('#fileup1').uploadify({
            'formData'     : {
            },
            'swf'      : '/assets/uploadify/uploadify.swf',
            'uploader' : '/admin/resource/upload',
            'cancelImg': '/assets/uploadify/uploadify-cancel.png',//单个取消上传的图片
            'onUploadSuccess': function (file, data, response) {
                var data = JSON.parse(data);
                if (data.status == 1) {
                    $('#headpic').val(data.data);
                    $('#thumb1').attr("src",data.data);
                    $('#thumb1').css("display","block");
                }

            }
        });

    });
</script>
{%endblock%}